#!/usr/bin/env node

console.log('PID:', process.pid);

const cp = require('child_process');

const cat  = cp.spawn('cat', ['./data.txt']);
const sort = cp.spawn('sort'),
const uniq = cp.spawn('uniq');

cat.stdout.pipe(sort.stdin);
sort.stdout.pipe(uniq.stdin);
uniq.stdout.pipe(process.stdout);
uniq.stderr.pipe(process.stderr);
